
' This library has no relation to the php side of the library. It is completely different
' and not intended to replicate any other libraries, even though it might do so by accident.

' There is likely more to come, I just wanted to add in a 2D array allocation function

Class Array2D
	
	#Rem
		Allocate a 2D array
		
		@author	muddy_shoes
		@updatedby	Nicholas Grant
		@site	http://monkeycoder.co.nz/Community/posts.php?topic=822
		
		@update	Added code compliance with Strict
		
		@param	int	width
		@param	int	height
		
		@return	Int
	#End
	Function Allocate:Int[][]( width:Int, height:Int )
		Local arr:Int[][] = New Int[width][]
		
		For Local index:Int = 0 Until width
			arr[index] = New Int[height]
		Next
		Return arr
	End
	
	Function AllocateInt:Int[][]( width:Int, height:Int )
		Local arr:Int[][] = New Int[width][]
		
		For Local index:Int = 0 Until width
			arr[index] = New Int[height]
		Next
		Return arr
	End
	
	Function AllocateFloat:Float[][]( width:Int, height:Int )
		Local arr:Float[][] = New Float[width][]
		
		For Local index:Int = 0 Until width
			arr[index] = New Float[height]
		Next
		Return arr
	End
	
	Function AllocateString:String[][]( width:Int, height:Int )
		Local arr:String[][] = New String[width][]
		
		For Local index:Int = 0 Until width
			arr[index] = New String[height]
		Next
		Return arr
	End

End

